<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="__CSS__/ex/common.css">
    <link rel="stylesheet" href="__CSS__/ex/login.css">
    <title>地址</title>
    <script src="__JS__/ios-web-app.js"></script>
</head>

<body style="padding-top: 38px">
<header class="normal_header">
    <div class="header_pic">
        <a href="javascript:history.back(-1)"><img src="__IMG__/ex/back_black.png" alt=""></a>
    </div>
    <p>编辑地址信息</p>
    <div class="header_pic"></div>
</header>
<section class="change_content">
    <ul class="change_ul">
        <li>
            <p>收件人姓名</p>
            <input type="text" placeholder="请输入收件人姓名" id="name" value="{$user.lottery_name}">
        </li>
        <li>
            <p>手机号</p>
            <input type="text" placeholder="请输入收件手机号" id="phone" value="{$user.lottery_phone}" >
        </li>
        <li>
            <p>详细地址</p>
            <input type="text" placeholder="请输入地址" id="address" value="{$user.lottery_address}" >
        </li>
    </ul>
    <div class="btn login_btn lsub" id='sub'>
        确认
    </div>
</section>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script>
    $('#sub').click(function () {
        $.ajax({
            type: "post",
            url: "{:U('User/address_info')}",
            data: {
                lottery_name: $('#name').val(),
                lottery_phone: $('#phone').val(),
                lottery_address: $('#address').val(),
            },
            dataType: "json",
            success: function (data) {
                if (data.code == 1) {
                    alert(data.message);
                    window.location.href="{:U('user/user_info')}";
                } else {
                    alert(data.message);
                }
            }
        });
    });
</script>
</body>

</html>